import {get, post} from '../../util/request/requests'

export default {
  loadArticles (currentPage, pageSize) {
    return post({
      url: '/freshman/list',
      params: {
        current: currentPage,
        size: pageSize
      }
    })
  },
  insertNotice (notice, typeId) {
    return post({
      url: '/notice/addOrUpdate',
      params: {
        notice,
        typeId
      }
    })
  },
  loadNotice (current, size, typeId) {
    return post({
      url: '/notice/list',
      params: {
        current,
        size,
        typeId
      }
    })
  },
  deleteNotice (id) {
    return get({
      url: '/notice/delete',
      params: {id}
    })
  },
  loadType () {
    return get({
      url: '/noticeType/getAll'
    })
  },
  updateType (typeId, noticeId) {
    return post({
      url: '/noticeType/update',
      params: {
        typeId,
        noticeId
      }
    })
  },
  getNotice (id) {
    return get({
      url: '/notice/getOne',
      params: {id}
    })
  }
}
